-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix path router #3592
base: main
Are you sure you want to change the base?
Prefix path router #3592
Conversation
❌ Deploy Preview for volto failed. Why did it fail? →
|
Passing run #7234 ↗︎Details:
Review all test suite changes for PR #3592 ↗︎ |
Link view now working, Image view still has issues with the download link which is not working (see this example) |
During the Volto Team meeting we agreed that we would have to put in place a whole round of Cypress tests pointing to a deployment using this. I can imagine that in the future will be quite easy to break the whole feature if one does not have in mind it. I think that could be time consuming, but might not have much difficulty. What do you think? |
@mamico @giuliaghisini could you share the reverse proxy config you have on such deployments? |
We should add some documentation about how to setup such a deployment. |
@sneridagh our deployment config is a bit complicated because there are several urls and frontend names, and it's made in varnish and not in nginx/apache. The conf itself for using this branch is easy. Here is an example for nginx:
|
@cekk One other thing is important to document, the prefix path /foo corresponds to the Plone root, not a /foo subfolder in Plone. |
Yes, /foo points to the root of Plone site |
@cekk To make it work I had to launch Volto with:
I would have expect that given a RAZZLE_PREFIX_PATH, the other would have adjusted automatically (as seamless mode promises). I am doing something wrong? because given a look at the code, it seems it should, right? |
@cekk Forget the question, I'm still asleep. 😅 |
Added tentative tests: #3719 see comments. |
I would like to take this forward. Locally looks good. I will checkout this branch on one of our projects first and see if I find some issues. State of this PR:This PR is based on There is another approach in this PR, which uses a store enhancer middleware to prefix all the router paths(amending history accordingly) and modified What's left are the cypress tests #3719 which should also account for prefix path in the URLs. I will try to have a look into them. I personally like the basename approach and let react-router handle the prefixes. However, we need to think about the non-router links and static assets. What do you think @sneridagh @davisagli @tiberiuichim @pnicolli ? |
@giuliaghisini @nileshgulia1 @sneridagh any chance we have this feature in master? |
I updated the branch and run:
Then I got the error: ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property 'publicPath'. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }
at validate (/home/user/git/volto/node_modules/webpack-dev-server/node_modules/schema-utils/dist/validate.js:115:11)
at new Server (/home/user/git/volto/node_modules/webpack-dev-server/lib/Server.js:231:5)
at new razzleDevServer (/home/user/git/volto/node_modules/razzle/config/razzleDevServer.js:10:5)
at /home/user/git/volto/node_modules/razzle/scripts/start.js:181:33
at processTicksAndRejections (node:internal/process/task_queues:96:5) I'll take a look at it. |
@wesleybl it's due to the changes in razzle.config.js |
@tiberiuichim I fixed this in: f011df6 |
@wesleybl I agree that we should have a basename set, that is the starting point in the PR, it takes care of prefixing for us. We need to identify the parts where the prefix is manually needed. For me, focus is more on trying to avoid affecting the future development of volto. Or if we should really introduce env vars starting with RAZZLE_ now. There are lof of efforts that uses another build system and maybe in future we might shift there. |
@nileshgulia1 basically, we need to manually prefix in the HTML tags In short, if we use the |
@sneridagh I sent you an email. |
I'll be happy to join as well. Just ping me in discord. |
@nileshgulia1 @sneridagh I documented in PLIP situations where it is necessary to manually prefix, when using |
This add scripts to start frontend configured for working copy prefixed
In 7f435b0 I tried to avoid this rendirect but when rendering happens on the server side, it was happening Not Found before the client rendered the page correctly.
prefixed-working-copy-acceptance-frontend-prod-start command
semantic-ui-react @plone/volto/components/theme/Image/Image appends the url prefix.
I wonder if this or similar could be included.. Anyway, I hope this will merged soon! :- ) |
@teekuningas In our use case, we want cookies to be shared. But perhaps your suggestion could be a setting. |
Interesting, I wonder if that would work for us too.. anyway, a setting would be enough, yes. |
@wesleybl @teekuningas I talked to @sneridagh during PloneConf, and we agreed that we should rewrite the PR. We should extract the useful parts from it and possibly rewrite the PLIP to ensure it works with the current setup and can be easily upgraded when we move to Seven. What do you think? I agree to provide support maybe we should get in touch soon and target a sprint for it? |
@nileshgulia1 That's exactly what I started doing with #6754. But instead of doing it all in one big PR, I think it's easier to split it up into multiple PRs. |
Enable to publish Volto site under a prefixPath, for example
www.mymainsite.com/prefixPath